package com.wangsd.web.config;

import com.wangsd.web.interceptor.AuthenticationInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class AuthenticationConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AuthenticationInterceptor())
                .addPathPatterns("/**/*")
                .excludePathPatterns("/user/*", "/msg/*")
                .excludePathPatterns("/html/index.html", "/swagger-ui.html")
                .excludePathPatterns("/**/*.js", "/**/*.css", "/login.html", "/register.html", "/favicon.ico");
    }
}
